<form class="form-horizontal form-validate form-modal" method="post" action="{:url('info')}">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">{$row['id'] > 0?'编辑分类':'添加分类'}</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="control-label">分类级别：</label>
                    <div class="col-sm-6 must">
                        <select class="input-xlarge" data-toggle="select2" data-notsearch="true" data-rule-required="true" name="pid">
                            <option value="0">顶级分类</option>
                            {$select|raw}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">分类名称：</label>
                    <div class="col-sm-6 must">
                        <input type="text" class="input-xlarge" data-rule-maxlength="10" data-rule-required="true"
                               name="name" value="{$row.name}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">分类简称：</label>
                    <div class="col-sm-6 ">
                        <input type="text" class="input-xlarge" data-rule-maxlength="10" name="m_name"
                               value="{$row.m_name}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">状态：</label>
                    <div class=" controls">
                        <label class="radio-inline">
                            <input name="status" value="1" {$row['status']==1?'checked':''} class="js_undertake "
                            type="radio" >
                            正常
                        </label>
                        <label class="radio-inline">
                            <input name="status" value="0" {$row['status']==0?'checked':''} class="js_undertake"
                            type="radio" >隐藏
                        </label>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="form-group">
                    <label class="control-label">运费计算方式：</label>
                    <div class="col-sm-5">
                        <select name="freight_template" data-rule-required="true" aria-required="true"
                                aria-invalid="true">
                            <option value="-1" selected>-- 使用默认运费模板 --</option>
                            {volist name="ShippingTpl" id="sfrow" }
                            <option value="{$sfrow.sf_id}" {$row[
                            'freight_template']==$sfrow['sf_id']?'selected':''}>{$sfrow.sf_name}{$sfrow['is_default']==1?'(默认)':''}</option>
                            {/volist}
                            {empty name="ShippingTpl"}
                            <option value="0" selected>-- 没有运费模板 --</option>
                            {/empty}
                        </select>

                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">是否推荐：</label>
                    <div class="col-sm-8 controls">
                        <label class="radio-inline">
                            <input name="is_best" value="1" {$row['is_best']==1?'checked':''} class="js_undertake "
                            type="radio" >
                            是
                        </label>
                        <label class="radio-inline">
                            <input name="is_best" value="0" {$row['is_best']==0?'checked':''} class="js_undertake"
                            type="radio" >否
                        </label>
                        <p><span class="help-inline">选择推荐将在分类列表中的推荐中额外显示其子类列表，其下级无子类，则设置也不显示</span></p>
                    </div>
                    <div class="clearfix"></div>
                </div>

                <div class="form-group">
                    <label class="control-label">分类图片：</label>
                    <div class="col-sm-7">
                        <div class="defUpImgBox" data-toggle="uploaderOne" data-type="image">
                            <img id="img_pic" src="{$row.pic|default='__STATIC__/main/img/image.png'}">
                            <input id="input_pic" type="hidden"  name="pic"  value="{$row.pic}">
                            <div class="tips">点击上传</div>
                        </div>

                        <p>
                            <span class="help-inline">图片尺寸：128*128像素</span>
                            <a href="javascript:;" onclick="$('#input_pic').val('');$('#img_pic').attr('src','__STATIC__/main/img/image.png');"><i class="fa fa-trash-o m-r-xs"></i>清除图片</a>
                        </p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">封面图片：</label>
                    <div class="col-sm-7">
                        <div class="defUpImgBox" data-toggle="uploaderOne">
                            <img id="img_cover" src="{$row.cover|default='__STATIC__/main/img/image.png'}">
                            <input id="inpit_cover" type="hidden"  name="cover"  value="{$row.cover}">
                            <div class="tips">点击上传</div>
                        </div>
                        <p>
                            <span class="help-inline">图片尺寸：750*420像素</span>
                            <a href="javascript:;" onclick="$('#inpit_cover').val('');$('#img_cover').attr('src','__STATIC__/main/img/image.png');"><i class="fa fa-trash-o m-r-xs"></i>清除图片</a>
                        </p>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <input type="hidden" name="id" value="{$row.id|intval}"/>
                <button type="submit" class="btn btn-primary" data-loading-text="保存中..." disabled>保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</form>
